<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="app">
        <com-head></com-head>
    </div>
</body>
<script src="./vue.js"></script>
<script>
    const child={
        template:`
            <div>
                <slot name='a'></slot>
                <div>我是子组件</div>
                <slot name='b'></slot>
            </div>
        `
    }
    const ComHead={
        template:`
            <div>
                <span>我是全局组件</span>
                <child>
                    <span slot='a'>465</span>
                    <span  slot='b'>789</span>
                </child>
                
            </div>
        `,
        components:{
            child
        }

    }
    Vue.component('ComHead',ComHead)
    const vm=new Vue({
        el:'#app',
        
    })
</script>
</html>